import 'dart:ui';

class MGColors {
  /// 背景色
  static Color backColor = hexColor("#F1F1F1");

  /// 主题色
  static Color themeColor = hexColor("#FDC20D");

  /// 卡片背景色
  static Color itemColor = hexColor("#FFFFFF");

  /// 分割线颜色
  static Color splitColor = hexColor("#EEEEEE");

  /// 文本颜色
  static Color text1Color = hexColor("#222222");
  static Color text2Color = hexColor("#666666");
  static Color text3Color = hexColor("#999999");
  static Color text4Color = hexColor("#BBBBBB");

  /// tabBar颜色
  static Color tabBarColor = hexColor("#FBFAFE");

  /// 红色
  static Color redColor = hexColor("#FF3B30");

  /// 白色
  static Color whileColor = hexColor("#FFFFFF");

  /// 蓝色
  static Color blueColor = hexColor("#1678FF");

  /// 绿色
  static Color greenColor = hexColor("#45B180");

  /// 黄色
  static Color yellowColor = hexColor("#FBE34B");

  static Color hexColor(String hexString) {
    String hex = hexString.replaceAll("#", "");
    if (hex.length == 6) {
      hex = 'FF$hex';
    } else if (hex.length == 3) {
      hex = 'FF${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}';
    }
    return Color(int.parse(hex, radix: 16));
  }
}
